﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VirtualDisk
{
    class Command
    {
        //模版方法
       public void execute()
       {
           int returnCode = run();
           processError(returnCode);
       }

        //真正的执行，子类需重定义
        protected virtual int run()
        {
            return 0;
        }
        //错误处理，子类需重定义
        protected virtual void processError(int returnCode)
        {

        }
 
    }

    
}
